home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / misc / poolfx92.lzh / POOLFIX4.HLP < prev    next >
Text File  |  1992-03-05  |  7KB  |  145 lines

  1. POOLFIX4 (Got to patch and get again and again... c'mon, Leila, gimme
  2. ========  a break - or: Reasons To Be Cheerful, Part 4)
  3.  
  4. Yep, it's true, TOS 1.4 is buggy. Well, ATARI has done something about
  5. it and released several fix programs to blow up your AUTO folder. A
  6. very... ahem... remarkable representative of this kind of programs is
  7. POOLFIX written by Allan Pratt which tries to fix a new bug in the pool
  8. manager. Allan released three versions of this program, and then he
  9. settled down with a long sigh of relieve thinking he did it right at
  10. last.
  11.  
  12. Well, he wasn't quite right. Allan's POOLFIX versions needed to be
  13. placed first in the AUTO folder because POOLFIX tries to locate
  14. some illegal system variables by following the TRAP #1 vector into
  15. ROM code. If any program occupies the TRAP #1 vector before POOLFIX
  16. shows up, things are messed up: POOLFIX refuses to install itself.
  17.  
  18. This isn't a big problem for most of you out there, but it is a
  19. problem for people using hard disk drivers and other programs that
  20. start up before AUTO folder programs and use the TRAP #1 vector
  21. for their own purposes. It is also a pain in the neck for everyone
  22. to be forced to re-order their AUTO folder once again, and as time
  23. passes by, you tend to forget which programs in the AUTO folder
  24. need to be started in which order, and soon chaos spreads.
  25.  
  26. I was faced with the problem when I realized that POOLFIX3 didn't
  27. want to install itself when my own hard disk driver (included in
  28. the book SCHEIBENKLEISTER), version 3.5, was running. This is due
  29. to the fact that I use the TRAP #1 vector in CBHD 3.5 (my HD driver)
  30. to do some DESKTOP.INF patching that my readers urged me to implement.
  31. The problem, however, could have been solved easily if POOLFIX would
  32. follow the official ATARI guidelines for XBRA completely. CBHD 3.5
  33. uses XBRA to notify other programs that it linked into the TRAP #1
  34. vector, and so it would be no problem for POOLFIX to follow the
  35. TRAP #1 XBRA chain into ROM. Allan, however, didn't think of this
  36. neat possibility - being able to follow the chain was, as far as
  37. I know, one of the main reasons for adopting the XBRA standard.
  38.  
  39. (The same problem occurs with FATSPEED, a freeware (?) GEMDOS
  40. speed-up for TOS 1.2; if the programmer of FATSPEED should read
  41. this some day, he or she should think of implementing this follow-
  42. the-chain-into-ROM-technique into FATSPEED, too. Tnx so much.)
  43.  
  44. As always, users are forced to do the patching themselves. In this
  45. case, I reassembled POOLFIX and inserted a full-blown XBRA algorithm.
  46. Apart from that, I optimized the program a bit so that it occupies
  47. lesser space in RAM than the previous version. It's also a bit
  48. shorter on disk, but since it uses 2 clusters as before, there's
  49. no speedup when booting. BTW: I used TURBO ASS for this job, a
  50. remarkably fast shareware assembler written by Markus Fritze and
  51. Sören Hellwig, Birkhahnkamp 38, 2000 Norderstedt 1, West Germany.
  52.  
  53. POOLFIX4, as I called it, has been tested successfully on my MegaST
  54. with TOS 1.4 in ROM, on my STE with TOS 1.6 in ROM, and with a 1040
  55. with TOS 1.2 (where it doesn't install itself since TOS 1.2 doesn't
  56. need the patch). If there are any incompatibilities with any programs,
  57. please tell me:
  58.  
  59.     Claus Brod
  60.     Am Felsenkeller 2
  61.     8772 Marktheidenfeld
  62.     West Germany
  63.     (049-)(0)9391-3206
  64.  
  65.     (e-mail: C.BROD@LINK-N (Zerberus net), soon also on FIDO and
  66.              Usenet)
  67.  
  68. This program should always be posted or copied with this documentation.
  69. I claim no rights on this program (how should I, most of the code
  70. is from Allan, who hopefully doesn't mind if I correct him this way),
  71. so it's freeware. Spread it. I said: Spread it! Did I say "spread it"?
  72. No? So I'll say it again: Spread it!
  73.  
  74. Sorry, Allan, but I HAD to do this for my readers. I will send ATARI
  75. a copy of this program, so that they may be able to use it as an
  76. official version (it's clearly better than the original). Let's
  77. wait and see if they want it.
  78.  
  79. ------------------------------------
  80. Atari Corp., January 19, 1990
  81.  
  82. There is a rare bug in Rainbow TOS (1.4) and STe TOS (1.6) involving
  83. the way GEMDOS handles its internal memory.  You probably have never
  84. seen this bug, and if you use this patch program, you never will.
  85.  
  86. Place POOLFIX3.PRG in your AUTO folder and reboot your machine.  That's
  87. all there is to it.  POOLFIX3.PRG will run every time you boot your
  88. machine, so the bug will never ever bite you.
  89.  
  90. You might get a message to the effect that it must run first in the
  91. AUTO folder.  If this happens, copy the programs from your AUTO folder
  92. to another place and erase them all from the AUTO folder.  Now copy
  93. POOLFIX3.PRG into your AUTO folder, and then all the other programs
  94. which were there.
  95.  
  96. (A version of this patch was released January 10; it didn't work, and
  97. shouldn't be used.  Another was released January 18; it didn't work
  98. either. (Look, I'm only human!)  This is Take 3.)
  99.  
  100. **********************************************************************
  101.  
  102. If you are interested in the technical details of why this program
  103. is necessary and what it does, read on:
  104.  
  105. The bug doesn't bite very often.  You probably haven't ever seen it. 
  106. It happens when programs use Malloc a lot and you have a lot of folders
  107. in your system.  (Yes, this bug was introduced as part of the code
  108. which got rid of the 40-folder limit.)
  109.  
  110. The OS pool is the internal memory used by GEMDOS to keep track of
  111. directories, files, handles, and internal memory.  Sometimes, GEMDOS
  112. uses only part of a block.  When there are two blocks that are only
  113. partly used, and the used parts would fit into one block, the space
  114. can be compacted to create one completely used block and one free
  115. block.
  116.  
  117. Unfortunately, there's a bug in the compaction routine.  This patch
  118. prevents that compaction routine from being executed, by doing the
  119. compaction (with a bug-free routine) before GEMDOS has a chance to.
  120.  
  121. This code runs before every GEMDOS call.  It uses a flag to tell
  122. whether it needs to run the compaction routine before it lets GEMDOS
  123. handle the call.  If the call is one of the Pterm calls, or an Mfree()
  124. call, it sets the flag so the compaction will run before the NEXT
  125. Gemdos call:
  126.  
  127.     new gemdos entry point:
  128.  
  129.         if (flag is set)
  130.             run compact;
  131.  
  132.         if (call is Mfree or one of the Pterm calls)
  133.             set the flag;
  134.         else
  135.             clear the flag;
  136.  
  137.         jump to the original gemdos entry point;
  138.  
  139.  
  140. The compaction routine runs through GEMDOS's internal memory using
  141. unpublished variables (don't you dare use them yourself!) and compacts
  142. empty space out of the memory blocks, so the routine inside GEMDOS
  143. never finds any space to compact, and the incorrect code never runs.
  144.  
  145.